<template>
  <el-menu class="el-menu-demo" mode="horizontal" :ellipsis="false" router>
    <el-menu-item index="/">
      <div class="flex items-center justify-center gap-2">
        <img src="/logo.png" alt="logo" class="h-6 w-aut">
        <span>文件服务</span>
      </div>
    </el-menu-item>
    <el-menu-item @click="toggleDark()">
      <button class="text-x i-ep-sunny dark:i-ep-moon " />
    </el-menu-item>
    <el-menu-item @click="logOut">
      <i class="text-x i-ep-switch-button" />
    </el-menu-item>
  </el-menu>
</template>

<script lang="ts" setup>
import { toggleDark } from '@/composables'
import { useRouter } from 'vue-router'
import { loginInfo } from '@/store/loginInfo'

const router = useRouter()
const logOut = () => {
  loginInfo.setIsLogin(false);
  router.push('/')
}
</script>


<style lang="scss">
.el-menu-demo {
  &.ep-menu--horizontal>.ep-menu-item:nth-child(1) {
    margin-right: auto;
  }
}
</style>
